﻿using System;
using System.Data;
using System.Data.Common;
using Hxj.Data;
using Hxj.Data.Common;

namespace Utility.Model
{

    /// <summary>
    /// 实体类TB_SMS_Message 。(属性说明自动提取数据库字段的描述信息)
    /// </summary>
    [Serializable]
    public class TB_SMS_Message : Entity
    {
        public class _
        {
            public static readonly Field All = new Field("*", "TB_SMS_Message");

            public static readonly Field SMSID = new Field("SMSID", "TB_SMS_Message", "主键ID");

            public static readonly Field Status = new Field("Status", "TB_SMS_Message", "状态(1未发送0已发送-1已撤销)");

            public static readonly Field Mobile1 = new Field("Mobile1", "TB_SMS_Message", "手机号1");

            public static readonly Field Mobile2 = new Field("Mobile2", "TB_SMS_Message", "手机号2");

            public static readonly Field RtxLoginName = new Field("RtxLoginName", "TB_SMS_Message", "RTX登录名");

            public static readonly Field QQ = new Field("QQ", "TB_SMS_Message", "QQ");

            public static readonly Field WebChat = new Field("WebChat", "TB_SMS_Message", "微信");

            public static readonly Field SiteLoginName = new Field("SiteLoginName", "TB_SMS_Message", "站内短信用户名");

            public static readonly Field Messge = new Field("Messge", "TB_SMS_Message", "短信内容");

            public static readonly Field CreateDate = new Field("CreateDate", "TB_SMS_Message", "创建时间");

            public static readonly Field SystemCode = new Field("SystemCode", "TB_SMS_Message", "所属系统");

            public static readonly Field BussinessID = new Field("BussinessID", "TB_SMS_Message", "业务数据ID");

            public static readonly Field SendUserName = new Field("SendUserName", "TB_SMS_Message", "发送人帐号");

            public static readonly Field SendIP = new Field("SendIP", "TB_SMS_Message", "发送人IP");

            public static readonly Field SendDate = new Field("SendDate", "TB_SMS_Message", "发送时间");

            public static readonly Field SendLoginName = new Field("SendLoginName", "TB_SMS_Message", "发送登录名");

            public static readonly Field IsInstant = new Field("IsInstant", "TB_SMS_Message", "是否即时发送(1即时0定时)");

            public static readonly Field ReceiveUserName = new Field("ReceiveUserName", "TB_SMS_Message", "接收人姓名");

            public static readonly Field ReceiveLoginName = new Field("ReceiveLoginName", "TB_SMS_Message", "接受人登录名");

            public static readonly Field IsRead = new Field("IsRead", "TB_SMS_Message", "是否已读(0未读1已读)");

            public static readonly Field SendType = new Field("SendType", "TB_SMS_Message", "发送类型(短信、RTX、站内短信、微信)");

            public static readonly Field AliTempletCode = new Field("AliTempletCode", "TB_SMS_Message", "AliTempletCode");

            public static readonly Field SendTempletMsg = new Field("SendTempletMsg", "TB_SMS_Message", "SendTempletMsg");
        }

        private string _SMSID;

        private int? _Status;

        private string _Mobile1;

        private string _Mobile2;

        private string _RtxLoginName;

        private string _QQ;

        private string _WebChat;

        private string _SiteLoginName;

        private string _Messge;

        private DateTime? _CreateDate;

        private string _SystemCode;

        private string _BussinessID;

        private string _SendUserName;

        private string _SendIP;

        private DateTime? _SendDate;

        private string _SendLoginName;

        private int? _IsInstant;

        private string _ReceiveUserName;

        private string _ReceiveLoginName;

        private int? _IsRead;

        private string _SendType;

        private string _AliTempletCode;

        private string _SendTempletMsg;

        public string SMSID
        {
            get
            {
                return _SMSID;
            }
            set
            {
                OnPropertyValueChange(_.SMSID, _SMSID, value);
                _SMSID = value;
            }
        }

        public int? Status
        {
            get
            {
                return _Status;
            }
            set
            {
                OnPropertyValueChange(_.Status, _Status, value);
                _Status = value;
            }
        }

        public string Mobile1
        {
            get
            {
                return _Mobile1;
            }
            set
            {
                OnPropertyValueChange(_.Mobile1, _Mobile1, value);
                _Mobile1 = value;
            }
        }

        public string Mobile2
        {
            get
            {
                return _Mobile2;
            }
            set
            {
                OnPropertyValueChange(_.Mobile2, _Mobile2, value);
                _Mobile2 = value;
            }
        }

        public string RtxLoginName
        {
            get
            {
                return _RtxLoginName;
            }
            set
            {
                OnPropertyValueChange(_.RtxLoginName, _RtxLoginName, value);
                _RtxLoginName = value;
            }
        }

        public string QQ
        {
            get
            {
                return _QQ;
            }
            set
            {
                OnPropertyValueChange(_.QQ, _QQ, value);
                _QQ = value;
            }
        }

        public string WebChat
        {
            get
            {
                return _WebChat;
            }
            set
            {
                OnPropertyValueChange(_.WebChat, _WebChat, value);
                _WebChat = value;
            }
        }

        public string SiteLoginName
        {
            get
            {
                return _SiteLoginName;
            }
            set
            {
                OnPropertyValueChange(_.SiteLoginName, _SiteLoginName, value);
                _SiteLoginName = value;
            }
        }

        public string Messge
        {
            get
            {
                return _Messge;
            }
            set
            {
                OnPropertyValueChange(_.Messge, _Messge, value);
                _Messge = value;
            }
        }

        public DateTime? CreateDate
        {
            get
            {
                return _CreateDate;
            }
            set
            {
                OnPropertyValueChange(_.CreateDate, _CreateDate, value);
                _CreateDate = value;
            }
        }

        public string SystemCode
        {
            get
            {
                return _SystemCode;
            }
            set
            {
                OnPropertyValueChange(_.SystemCode, _SystemCode, value);
                _SystemCode = value;
            }
        }

        public string BussinessID
        {
            get
            {
                return _BussinessID;
            }
            set
            {
                OnPropertyValueChange(_.BussinessID, _BussinessID, value);
                _BussinessID = value;
            }
        }

        public string SendUserName
        {
            get
            {
                return _SendUserName;
            }
            set
            {
                OnPropertyValueChange(_.SendUserName, _SendUserName, value);
                _SendUserName = value;
            }
        }

        public string SendIP
        {
            get
            {
                return _SendIP;
            }
            set
            {
                OnPropertyValueChange(_.SendIP, _SendIP, value);
                _SendIP = value;
            }
        }

        public DateTime? SendDate
        {
            get
            {
                return _SendDate;
            }
            set
            {
                OnPropertyValueChange(_.SendDate, _SendDate, value);
                _SendDate = value;
            }
        }

        public string SendLoginName
        {
            get
            {
                return _SendLoginName;
            }
            set
            {
                OnPropertyValueChange(_.SendLoginName, _SendLoginName, value);
                _SendLoginName = value;
            }
        }

        public int? IsInstant
        {
            get
            {
                return _IsInstant;
            }
            set
            {
                OnPropertyValueChange(_.IsInstant, _IsInstant, value);
                _IsInstant = value;
            }
        }

        public string ReceiveUserName
        {
            get
            {
                return _ReceiveUserName;
            }
            set
            {
                OnPropertyValueChange(_.ReceiveUserName, _ReceiveUserName, value);
                _ReceiveUserName = value;
            }
        }

        public string ReceiveLoginName
        {
            get
            {
                return _ReceiveLoginName;
            }
            set
            {
                OnPropertyValueChange(_.ReceiveLoginName, _ReceiveLoginName, value);
                _ReceiveLoginName = value;
            }
        }

        public int? IsRead
        {
            get
            {
                return _IsRead;
            }
            set
            {
                OnPropertyValueChange(_.IsRead, _IsRead, value);
                _IsRead = value;
            }
        }

        public string SendType
        {
            get
            {
                return _SendType;
            }
            set
            {
                OnPropertyValueChange(_.SendType, _SendType, value);
                _SendType = value;
            }
        }

        public string AliTempletCode
        {
            get
            {
                return _AliTempletCode;
            }
            set
            {
                OnPropertyValueChange(_.AliTempletCode, _AliTempletCode, value);
                _AliTempletCode = value;
            }
        }

        public string SendTempletMsg
        {
            get
            {
                return _SendTempletMsg;
            }
            set
            {
                OnPropertyValueChange(_.SendTempletMsg, _SendTempletMsg, value);
                _SendTempletMsg = value;
            }
        }

        public TB_SMS_Message()
            : base("TB_SMS_Message")
        {
            _SMSID = Guid.NewGuid().ToString();
            _Status = 0;
            _CreateDate = DateTime.Now;
        }

        public override Field[] GetPrimaryKeyFields()
        {
            return new Field[1]
            {
            _.SMSID
            };
        }

        public override Field[] GetFields()
        {
            return new Field[23]
            {
            _.SMSID,
            _.Status,
            _.Mobile1,
            _.Mobile2,
            _.RtxLoginName,
            _.QQ,
            _.WebChat,
            _.SiteLoginName,
            _.Messge,
            _.CreateDate,
            _.SystemCode,
            _.BussinessID,
            _.SendUserName,
            _.SendIP,
            _.SendDate,
            _.SendLoginName,
            _.IsInstant,
            _.ReceiveUserName,
            _.ReceiveLoginName,
            _.IsRead,
            _.SendType,
            _.AliTempletCode,
            _.SendTempletMsg
            };
        }

        public override object[] GetValues()
        {
            return new object[23]
            {
            _SMSID,
            _Status,
            _Mobile1,
            _Mobile2,
            _RtxLoginName,
            _QQ,
            _WebChat,
            _SiteLoginName,
            _Messge,
            _CreateDate,
            _SystemCode,
            _BussinessID,
            _SendUserName,
            _SendIP,
            _SendDate,
            _SendLoginName,
            _IsInstant,
            _ReceiveUserName,
            _ReceiveLoginName,
            _IsRead,
            _SendType,
            _AliTempletCode,
            _SendTempletMsg
            };
        }

        public override void SetPropertyValues(IDataReader reader)
        {
            _SMSID = DataUtils.ConvertValue<string>(reader["SMSID"]);
            _Status = DataUtils.ConvertValue<int?>(reader["Status"]);
            _Mobile1 = DataUtils.ConvertValue<string>(reader["Mobile1"]);
            _Mobile2 = DataUtils.ConvertValue<string>(reader["Mobile2"]);
            _RtxLoginName = DataUtils.ConvertValue<string>(reader["RtxLoginName"]);
            _QQ = DataUtils.ConvertValue<string>(reader["QQ"]);
            _WebChat = DataUtils.ConvertValue<string>(reader["WebChat"]);
            _SiteLoginName = DataUtils.ConvertValue<string>(reader["SiteLoginName"]);
            _Messge = DataUtils.ConvertValue<string>(reader["Messge"]);
            _CreateDate = DataUtils.ConvertValue<DateTime?>(reader["CreateDate"]);
            _SystemCode = DataUtils.ConvertValue<string>(reader["SystemCode"]);
            _BussinessID = DataUtils.ConvertValue<string>(reader["BussinessID"]);
            _SendUserName = DataUtils.ConvertValue<string>(reader["SendUserName"]);
            _SendIP = DataUtils.ConvertValue<string>(reader["SendIP"]);
            _SendDate = DataUtils.ConvertValue<DateTime?>(reader["SendDate"]);
            _SendLoginName = DataUtils.ConvertValue<string>(reader["SendLoginName"]);
            _IsInstant = DataUtils.ConvertValue<int?>(reader["IsInstant"]);
            _ReceiveUserName = DataUtils.ConvertValue<string>(reader["ReceiveUserName"]);
            _ReceiveLoginName = DataUtils.ConvertValue<string>(reader["ReceiveLoginName"]);
            _IsRead = DataUtils.ConvertValue<int?>(reader["IsRead"]);
            _SendType = DataUtils.ConvertValue<string>(reader["SendType"]);
            _AliTempletCode = DataUtils.ConvertValue<string>(reader["AliTempletCode"]);
            _SendTempletMsg = DataUtils.ConvertValue<string>(reader["SendTempletMsg"]);
        }

        public override void SetPropertyValues(DataRow row)
        {
            _SMSID = DataUtils.ConvertValue<string>(row["SMSID"]);
            _Status = DataUtils.ConvertValue<int?>(row["Status"]);
            _Mobile1 = DataUtils.ConvertValue<string>(row["Mobile1"]);
            _Mobile2 = DataUtils.ConvertValue<string>(row["Mobile2"]);
            _RtxLoginName = DataUtils.ConvertValue<string>(row["RtxLoginName"]);
            _QQ = DataUtils.ConvertValue<string>(row["QQ"]);
            _WebChat = DataUtils.ConvertValue<string>(row["WebChat"]);
            _SiteLoginName = DataUtils.ConvertValue<string>(row["SiteLoginName"]);
            _Messge = DataUtils.ConvertValue<string>(row["Messge"]);
            _CreateDate = DataUtils.ConvertValue<DateTime?>(row["CreateDate"]);
            _SystemCode = DataUtils.ConvertValue<string>(row["SystemCode"]);
            _BussinessID = DataUtils.ConvertValue<string>(row["BussinessID"]);
            _SendUserName = DataUtils.ConvertValue<string>(row["SendUserName"]);
            _SendIP = DataUtils.ConvertValue<string>(row["SendIP"]);
            _SendDate = DataUtils.ConvertValue<DateTime?>(row["SendDate"]);
            _SendLoginName = DataUtils.ConvertValue<string>(row["SendLoginName"]);
            _IsInstant = DataUtils.ConvertValue<int?>(row["IsInstant"]);
            _ReceiveUserName = DataUtils.ConvertValue<string>(row["ReceiveUserName"]);
            _ReceiveLoginName = DataUtils.ConvertValue<string>(row["ReceiveLoginName"]);
            _IsRead = DataUtils.ConvertValue<int?>(row["IsRead"]);
            _SendType = DataUtils.ConvertValue<string>(row["SendType"]);
            _AliTempletCode = DataUtils.ConvertValue<string>(row["AliTempletCode"]);
            _SendTempletMsg = DataUtils.ConvertValue<string>(row["SendTempletMsg"]);
        }
    }
}